/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.inse6260.atms.model;

/**
 * @author seif
 */
public class Deposit implements Transaction
{
    private int accountNumber;
    private float depositamount;
    private BankDatabase bankDatabase;

    public Deposit (BankDatabase bankDatabase, int accountNumber, float depositamount)
    {
        // initialize fields
        this.accountNumber = accountNumber;
        this.depositamount = depositamount;
        this.bankDatabase = bankDatabase;
    }

    /**
     * Executes transaction
     */
    public void execute()
    {
        bankDatabase.insertTransLineItem(accountNumber, "credit", depositamount);
        bankDatabase.credit(accountNumber, depositamount);
    }
}
